package demo.swagger;


import demo.util.enums.NameValueEnum;
import demo.validation.annotation.EnumValue;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author meilin.huang
 * @create 2020/11/13 21:16
 */
@Target({ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ApiModelEnumProperty {

    /**
     * 字段名
     */
    String value();

    /**
     * 枚举类
     */
    Class<? extends Enum<? extends NameValueEnum>> enumClass() default EnumValue.DefaultNameValueEnum.class;

    /**
     * 可选枚举值，即swagger只会显示该指定值对应的枚举描述，支持String, Integer
     */
    String[] values() default {};

    boolean required() default false;
}

